<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <title>考试模块</title>

        <!-- Path to Framework7 Library CSS-->
        <!--     <link rel="stylesheet" href="/vistor/resources/css/framework7.ios.min.css">
        <link rel="stylesheet" href="/vistor/resources/css/framework7.ios.colors.min.css">
         -->
        <script src="js/flexible.js"></script>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/daterangepicker-bs3.css" rel="stylesheet">
        <link href="css/bootstrapValidator.min.css" rel="stylesheet">
        <link href="font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
        <!-- <link rel="stylesheet" href="css/layer.css"> -->
        <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
        <link rel="stylesheet" href="css/index.css" />
        <script src="js/vue"></script>
        <script src="js/jquery-1.12.3.min.js"></script>
        <script src="bootstrap.min.js"></script>
        <script src="https://unpkg.com/element-ui/lib/index.js"></script>
        <script type="text/javascript" src="js/moment.js">
        </script>
        <script type="text/javascript" src="js/daterangepicker.js"></script>
        <script src="js/bootstrapValidator.min.js"></script>
        <script src="js/echarts.common.min.js"></script>
        <script src="js/layer.js"></script>
        <script src="js/index.js"></script>
        <script>
          //localStorage.removeItem("userid");
          //localStorage.removeItem("username");
        </script>
	
    </head>

    <body>
        <div id="page-wrapper" class="">
            <div id="page-container" class="header-fixed-top sidebar-visible-lg-full">
                <!-- Main Container -->
                <div id="main-container" class="container">
                    <!-- Page content -->
                    <div id="page-content" class="row">
                        <!-- 页头开始 -->
                        
                        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                            <el-menu-item index="1">首页</el-menu-item>
                            <el-submenu index="2">
                                <template slot="title">考试管理</template>
                                <el-menu-item index="2-1">试卷管理</el-menu-item>
                                <el-menu-item index="2-2">题目管理</el-menu-item>
                            </el-submenu>
                            <el-submenu index="3">
                                <template slot="title">系统管理</template>
                                <el-menu-item index="3-1">权限管理</el-menu-item>
                                <el-menu-item index="3-2">目录管理</el-menu-item>
                                <el-menu-item index="3-3">日志管理</el-menu-item>
                            </el-submenu>

                            <el-menu-item index="4">登录</el-menu-item>
                        </el-menu>
                        <div class="block">
                            <div class="addTest">
                                <button type="button" class="btn btn-primary btn-lg addTestBtn" >新建试卷</button>

                            </div>
                        
                            <div class="edit-container">
                                <!-- <div class="edit-title">
                                    <h2>这里是标题</h2>
                                    <input type="text" class="add-title" name="testTitle">

                                    <h3>这里是试卷描述</h3>
                                    <input type="text" class="add-des" name="testDes">
                                </div> -->
                                    
                                <div class="content">
                                    
                                    <div class="well clearfix">
                                        <div class="control-group col-xs-12 col-md-6">
                                            <label class="control-label">请输入问卷标题</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                                                    <input type="text" name="testTitle" class="form-control" placeholder="请输入问卷标题" class="span4" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group col-xs-6 col-md-4">
                                            <label class="control-label">请输入问卷描述</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <span class="add-on input-group-addon"><i class="glyphicon glyphicon-clock-o fa fa-clock-o"></i></span>
                                                    <input type="text" name="testDes" class="form-control" placeholder="请输入问卷描述">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group col-xs-6 col-md-2">
                                            <label class="control-label">请输入测试部门</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <span class="add-on input-group-addon"><i class="glyphicon glyphicon-clock-o fa fa-clock-o"></i></span>
                                                    <input type="text" name="deptType" class="form-control" placeholder="部门">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="control-group col-md-5 col-xs-6">
                                            <label class="control-label">选择可答题时间范围</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                                                    <input type="text" name="reservation" id="reservationtime" class="form-control" value="2017-12-01 00:00 - 2017-12-02 00:30" readonly class="span4" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group col-md-3 col-xs-6">
                                            <label class="control-label" for="reservationtime">选择最长答题时间限制</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <span class="add-on input-group-addon"><i class="glyphicon glyphicon-clock-o fa fa-clock-o"></i></span>
                                                    <input type="number" name="testTime" min="0" step="10" class="form-control" value="60">
                                                    <div class="input-group-addon">分钟</div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group col-md-2 col-xs-6">
                                            <label class="control-label">请输入问卷总分</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <input type="number" name="totalPoint" class="form-control" disabled class="span4">
                                                    <div class="input-group-addon">分</div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group col-md-2 col-xs-6">
                                            <label class="control-label" for="reservationtime">请输入及格分数</label>
                                            <div class="controls">
                                                <div class="input-prepend input-group">
                                                    <input type="number" name="passPoint" value="" class="form-control">
                                                    <div class="input-group-addon">分</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="questions" v-for="(qs, index) in questions">
                                        <div v-html="qs.content"></div>
                                        <div class="qs-control">
                                            <ul>
                                                <li class="qs-del" onclick="delQs(this)">删除</li>
                                                <li class="qs-edit" @click="editQs(this, index)">编辑</li>
                                            </ul>
                                        </div>
                                    </div>

                                    <div class="add">
                                        <div class="add-option">
                                            <button class="btn btn-primary" @click="addQs(1)">单选</button>
                                            <button class="btn btn-primary" @click="addQs(2)">多选</button>
                                            <button class="btn btn-primary" @click="addQs(4)">填空</button>
                                            <button class="btn btn-primary" @click="addQs(5)">问答</button>
                                            <button class="btn btn-primary fromTestLib">从题库导入</button>
                                        </div>
                                        <div class="add-item">
                                            <span>添加问题</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="modal fade bs-example-modal-lg in" id="testLibModel" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false"> 
                                    <div class="modal-dialog modal-lg"> 
                                        <div class="modal-content" id="personAddModelContent"> 
                                            <div class="modal-header"> 
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> 
                                                <span class="modal-header-title" id="myModalLabel">题库</span> 
                                            </div> 
                                            <div class="modal-body clearfix"> 
                                                <div class="panel-group" id="resources" role="tablist" aria-multiselectable="true">
                                                    
                                                </div>
                                                <button class="btn btn-primary pull-right addLibQs">添加到试卷</button>
                                            </div> 
                                            <div class="modal-footer" id="pagination"> 
                                            </div>
                                        </div>
                                    </div> 
                                </div>

                                <el-dialog title="在下面的输入框中输入问题详情" :visible.sync="addQ" @open="show">
                                    <el-form ref="form" :model="form" label-width="80px" size="mini">
                                        <el-form-item  label="问题标题" prop="name" :rules="[ { required: true, message: '请输入问题标题', trigger: 'blur' }]">
                                            <el-input v-model="form.name" class="name"></el-input>
                                        </el-form-item>
                                        <el-form-item label="问题描述">
                                            <el-input v-model="form.desc" class="desc"></el-input>
                                        </el-form-item>
                                        <el-form-item label="所属部门" prop="dept" :rules="[ { required: true, message: '请输入问题所属部门', trigger: 'blur' }]">
                                            <el-input v-model="form.dept" class="dept">
                                                <template slot="append">部</template>
                                            </el-input>
                                        </el-form-item>
                                        <el-form-item label="问题分数" prop="score" :rules="[ { required: true, message: '请输入问题分数', trigger: 'blur' }]">
                                            <el-input v-model="form.score" class="score">
                                                <template slot="append">分</template>
                                            </el-input>
                                        </el-form-item>
                                        <input type="hidden" v-model="form.id">
                                    </el-form>
                                    <table class="table addOption" v-html="option">
                                        
                                    </table>
                                    <div class="alterItem" v-if="type=='1' || type== 2">
                                        <button class="btn btn-default" onclick="delChoice()">减少选项</button>
                                        <button class="btn btn-default" @click="addChoice">增加选项</button>
                                    </div>

                                    <hr>
                                    <div class="addBtnGroup">
                                        <button class="btn btn-primary" v-if="submit" @click="isOpen && qsSubmit('form')">提交</button>
                                        <button class="btn btn-success" v-if="!submit" @click="isOpen && qsSubmit('form')">保存</button>
                                    </div>
                                </el-dialog>

                                <div class="publish">
                                    <button class="btn btn-primary publishBtn">发布问卷</button>
                                </div>

                                <div class="edit">
                                    <button class="btn btn-primary editBtn">修改问卷</button>
                                </div>
                            </div>

                            <div class="data-container">
                                <div class="data"> 
                                </div>
                            </div>

                            <div class="test-list">
                                <el-row type="flex" justify="space-around" align="middle">
                                    
                                    <div class="handle-box">
                                        <el-input v-model="select_word" placeholder="筛选关键词" class="handle-input mr10"></el-input>
                                        <el-button type="primary" icon="search" @click="search">搜索</el-button>
                                    </div>

                                    <div class="add-qs">
                                        <el-button type="danger" class="add-btn" @click="handleAdd()">+&nbsp;&nbsp;新建问卷</el-button>
                                    </div>
                                </el-row>
                                <el-table :data="data" style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
                                    <el-table-column type="expand">
                                      <template slot-scope="props">
                                        <el-form label-position="left" inline class="demo-table-expand">
                                            <el-form-item label="试卷 ID">
                                                <span>{{ props.row.id }}</span>
                                            </el-form-item>
                                            <el-form-item label="考试限时">
                                                <span>{{ props.row.testTime }}分钟</span>
                                            </el-form-item>    
                                            <el-form-item label="创建人">
                                                <span>{{ props.row.creatorName }}</span>
                                            </el-form-item>
                                            <el-form-item label="创建时间">
                                                <span>{{ props.row.createTime }}</span>
                                            </el-form-item>
                                            <el-form-item label="最后修改人">
                                                <span>{{ props.row.finalUpdateName }}</span>
                                            </el-form-item>
                                            <el-form-item label="最后修改时间">
                                                <span>{{ props.row.finalUpdateTime }}</span>
                                            </el-form-item>
                                            <el-form-item label="开始考试时间">
                                                <span>{{ props.row.startTime }}</span>
                                            </el-form-item>
                                            <el-form-item label="结束考试时间">
                                                <span>{{ props.row.endTime }}</span>
                                            </el-form-item> 
                                            <el-form-item label="试卷总分">
                                                <span>{{ props.row.totalPoint }}分</span>
                                            </el-form-item>
                                            <el-form-item label="试卷及格分">
                                                <span>{{ props.row.passPoint }}分</span>
                                            </el-form-item>
                                        </el-form>
                                      </template>
                                    </el-table-column>

                                    <el-table-column label="试卷名称" prop="name">
                                    </el-table-column>

                                    <el-table-column label="部门" prop="deptType">
                                    </el-table-column>

                                    <el-table-column label="描述" prop="description">
                                    </el-table-column>

                                    <el-table-column label="操作">
                                        <template slot-scope="scope">
                                            <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                                            <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                                            <el-button size="small" type="primary" @click="toExam(scope.$index, scope.row)">查看答卷</el-button>
                                        </template>
                                    </el-table-column>
                                </el-table>
                                <div class="pagination pull-right">
                                    <el-pagination
                                            @current-change ="handleCurrentChange"
                                            background
                                            layout="prev, pager, next"
                                            :total="totalRows"
                                            :page-size="size">
                                    </el-pagination>
                                </div>
                            </div>
                        </div>  

                        <!-- <div class="previous-container">
                        </div>    -->       
                        
                    </div>
                    <!-- END Main Container -->
                </div>
                <!-- END Page Container -->
            </div>

            <footer id="footer" class="copyright">
                <p>© 高新兴集团股份有限公司 IT流程体系部 </p>
                <p>© Gosuncn Technology Group Co.,Ltd.</p>
                <p>All rights reserved.</p>
            </footer>
        </div>
        
        <!-- END Page Wrapper -->
        <!-- jQuery, Bootstrap, jQuery plugins and Custom JS code -->
        <!-- <script type="text/javascript" src="https://g.alicdn.com/dingding/dingtalk-pc-api/2.7.0/index.js"></script> -->
        <!-- <script src="js/ding.js"></script>
        <script src="js/plugins.js"></script> -->
        <!-- <script src="js/app.js"></script> -->
        <!-- Load and execute javascript code used only in this page -->


        
        <script>
            new Vue({
                el: '#page-wrapper',
                data() {
                    return {
                        activeIndex: '2-1',
                        url: 'http://192.168.18.205/exam-api/exam/page',
                        tableData: [],
                        cur_page: 1,
                        size: 9,
                        totalRows: 10,
                        select_word: '',
                        is_search: false,
                        type: '',
                        index: 0,
                        option: '',
                        content: '<p>sss</p>',
                        addQ: false,
                        submit: true,
                        form: {
                            domains: [{
                                value: ''
                            }]
                        },
                        isOpen: false,
                        questions: [
                            {content: ''}
                        ]
                    }
                },
                created(){
                    this.getData();
                },
                computed: {
                    data(){
                        const self = this;
                        if (self.tableData.length > 0) {
                            return self.tableData.filter(function(d) {
                                if (d.name.indexOf(self.select_word) > -1 || d.deptType.indexOf(self.select_word) > -1 || d.description.indexOf(self.select_word) > -1) {
                                      return d;
                                }
                            })
                        }
                        
                    },
                    username(){
                        let username = localStorage.getItem('ms_username');
                        return username ? username : this.name;
                    }
                },
                methods: {
                    handleSelect(key, keyPath) {
                        console.log(key, keyPath)
                        if (key == "1") {
                           location.href = "test.html";
                        } else if (key == "2-1") {
                            location.href = "index.html";
                        } else if (key == "2-2") {
                            location.href = "questions.html";
                        } else if (key == "3") {
                            location.href = "index.html";
                        } else if (key == "4") {
                            location.href = "login.html"
                        } 
                    },
                    handleCurrentChange(val){
                        this.cur_page = val;
                        this.getData();
                    },
                    getData(){
                        let self = this;
                        $.ajax({
                            method: 'get',
                            url: self.url,
                            data: {offset: self.cur_page, size: self.size},
                            success: function(res) {
                                self.totalRows = res.totalRows;
                                self.tableData = res.resources;
                            }
                        });
                      // self.$axios.post(self.url, {page:self.cur_page}).then((res) => {
                      //     self.tableData = res.list;
                      // })
                    },
                    search(){
                        this.is_search = true;
                    },
                    formatter(row, column) {
                        return row.address;
                    },
                    filterTag(value, row) {
                        return row.tag === value;
                    },
                    addQs(type) {
                        this.submit = true;
                        this.type = type;
                        this.addQ = true;
                        this.form = {};
                        var choice_list = addQs(type);
                        this.option = choice_list;
                    },
                    editQs(that, index) {
                        let self = this;
                        
                         self.$confirm('确定编辑吗', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            self.addQ = true;

                            self.form = {};
                            var edit_index = index - 1;
                            var edit_question = $('.edit-container .questions').eq(edit_index);
                            self.index = edit_index;

                            var edit_type = edit_question.find('.qs-type').html();
                            self.type = edit_type;
                            
                            self.form.score = edit_question.find('.score').val();
                            self.form.desc = edit_question.find('.desc').val();
                            self.form.dept = edit_question.find('.dept').val();
                            self.form.name = edit_question.find('.title-text').html();
                            

                            var rightIndex = [];
                            var right_list = edit_question.find('input:checked');
                            
                            var option_label = edit_question.find('label');
                            var edit_length = edit_question.find('.qs-options').length;
                            if (edit_type == "单选" || edit_type == "多选") {
                                var option_list = [];
                                $.each(right_list, function (index, val) {
                                    rightIndex.push($(this).parent().index() - 1);
                                });
                                console.log(rightIndex);
                                
                                $.each(option_label, function (index, val) {
                                    option_list.push(this.innerHTML.split('、')[1]);
                                });
                                var choice_list = addQs(edit_type, edit_length, rightIndex, option_list);
                            } else if (edit_type == "填空") {
                                $.each(edit_question.find('input'), function (index, val) {
                                    rightIndex.push($(this).val());
                                });
                                var choice_list = addQs(edit_type, edit_length, rightIndex);
                            }

                            self.option = choice_list;
                            self.submit = false;
                        });
                        
                        
                    },
                    show() {
                        let self = this;
                        self.$nextTick(function () {
                            self.isOpen = true;
                        })
                    },
                    qsSubmit(formName) {
                        let self = this;
                        self.$refs[formName].validate((valid) => {
                            if (valid) {
                                if (checkQs()) {
                                    self.$confirm('确定提交吗', '提示', {
                                        confirmButtonText: '确定',
                                        cancelButtonText: '取消',
                                        type: 'warning'
                                    }).then(() => {
                                        self.form.info = {
                                            "score": self.form.score,
                                            "desc": self.form.desc,
                                            "dept": self.form.dept,
                                        }
                                        let options_wrap = "";
                                        if (self.submit) {
                                            options_wrap = addOptions(self.type, null, self.form.name, self.form.info);
                                            let options = options_wrap;
                                            self.questions.push({content: options});
                                            self.addQ = false;
                                        } else {
                                            options_wrap = addOptions(self.type, self.index, self.form.name, self.form.info);
                                            let options = options_wrap;
                                            self.questions.splice(self.index+1, 1, { content: options });
                                            self.addQ = false;
                                        }
                                        var totalScore = 0;
                                        
                                        setTimeout(() => {
                                            $.each($('.qs-score'), function (index, val) {
                                                console.log($(this).html().split('分')[0]);
                                                totalScore += parseInt($(this).html().split('分')[0]);
                                            });
                                            $('input[name="totalPoint"]').val(totalScore);

                                            var asc = function (a, b) {
                                                return $(a).find('.qs-index').html() > $(b).find('.qs-index').html() ? 1 : -1;
                                            }
                                            var sortEle = $('.questions').sort(asc);
                                            $('.edit-container .questions').remove();
                                            $('.add').before(sortEle)
                                        }, 0);
                                        
                                    }).catch(() => {
                                        self.$message({
                                            type: 'info',
                                            message: '已取消提交'
                                        });

                                    });
                                }
                            } else {
                                console.log('提交失败!!');
                                return false;
                            }
                        });
                    },
                    addChoice() {
                        addChoice(this.type);
                    },
                    handleAdd() {
                        addTest(this);
                    },
                    handleEdit(index, row) {
                        editTest(row.id, this)
                    },
                    handleDelete(index, row) {
                        let self = this;
                        self.$confirm('确认删除该问卷?', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            $.ajax({
                                url: url + '/exam-api/exam/'+ row.id +'/0',
                                type: 'post',
                                success: function (result) {
                                    self.$message({
                                        type: 'success',
                                        message: '删除成功!'
                                    });
                                    setTimeout(function() {
                                        window.location.reload();
                                    },500)
                                    
                                }
                            });

                        }).catch(() => {
                            self.$message({
                                type: 'info',
                                message: '已取消删除'
                            });          
                        });
                    },
                    handleSelectionChange(val) {
                        this.multipleSelection = val;
                    },
                    toExam(index, row) {
                        location.href = "exam.html"+"?eid="+row.id;
                    }
                }
            })
            $('#reservationtime').daterangepicker({
                startDate: '2017-12-01 00:00',
                endDate: '2017-12-02 00:00',
                timePicker: true,
                timePicker12Hour: false,
                timePickerIncrement: 30,
                format: 'YYYY-MM-DD HH:mm'
            }, function(start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
            });

            
            // $(document).ready(function(){
        	
           	//   var agentId=null;
            //   var corpId=null;
            //   var timeStamp =null;
            //   var nonceStr=null;
            //   var signature =null;
            //   $.ajax({
            // 		type:"get",
            // 		async: false, 
            // 		url:'https://ding.gosuncn.com:444/getConfig?signUrl='+window.location.href,
            // 		dataType:'jsonp',
            // 		jsonp: "callback",
            // 		jsonpCallback:'getConfig',
            // 	  success:function(data){
           	// 		  console.log(data);
           			
           	// 		  agentId = data.agentid;
         	  //       corpId =data.corpId;
         	  //       timeStamp = data.timeStamp;
         	  //       nonceStr= data.nonceStr;
         	  //       signature =data.signature;
         			
         	  //       console.log("corpId"+corpId);
         	  //       console.log("signature"+signature);
           			
            //  	    DingTalkPC.config({
            //  				agentId :agentId,
            //  				corpId : corpId,
            //  				timeStamp :timeStamp,
            //  				nonceStr :nonceStr,
            //  				signature :signature,
            //  				jsApiList : [ 'runtime.permission.requestAuthCode','biz.contact.choose','device.notification.alert' ]
            //  			});
           			
           			
            //  			DingTalkPC.ready(function() {
             				
            //  				if(localStorage.getItem("userid")==null) {
          	
            //  					DingTalkPC.runtime.permission.requestAuthCode({
            //      						corpId: corpId,
            //      						onSuccess: function (info) {
                    						
            //      						 $.ajax({
            //      				    		type:"get",
            //      				    		async: false, 
            //      				    		url:'https://ding.gosuncn.com:444/getUserInfo?code=' + info.code + '&corpid='
            //  								+ corpId,
            //      				    		dataType:'jsonp',
            //      				    		jsonp: "callback",
            //      				    		jsonpCallback:'getUserInfo',
            //      								success: function (data) {
            //      									console.log(data);
            //      									var info =data;
          										
            //      									$("#sqr").val(info.name);
            //      									$("#sqrid").val(info.userid);
                 									
            //      									localStorage.setItem("username", info.name);
            //      									localStorage.setItem("userid", info.userid);

            //      								},
            //      								error: function (error) {
                 									
            //      									console.log(errorType + ', ' + error);
            //      								}
            //      							});

            //      						},
            //      						onFail: function (err) {
            //      							console.log('fail: ' + JSON.stringify(err));
            //      						}
            //      					});
            //      				}else{
                 					
            //      				}
            //  			})

            //  			DingTalkPC.error(function(err) {
            //  				console.log('error: ' + JSON.stringify(err.errorCode));
             				
            //  					$.ajax({
          		// 	    		type:"get",
          		// 	    		async: false, 
          		// 	    		url:'https://ding.gosuncn.com:444/error',
          		// 	    		dataType:'jsonp',
          		// 	    		jsonp: "callback",
          		// 	    		jsonpCallback:'getConfig',
          		// 	    		complete:function(data){
          		// 	    			location.reload();
          		// 	    		}
            //  					})
            //  			});
           			
           	// 	  }
           		
           	//   })
           			 
            // })
            
            // if(localStorage.getItem("userid")==null){

            // } else{
            //   $("#sqrid").val(localStorage.getItem("userid"));
            //   $("#sqr").val(localStorage.getItem("username"));
            // }

          //在此拿到权限验证配置所需要的信息
        </script>
        <!-- <script src="https://g.alicdn.com/dingding/dingtalk-pc-api/2.4.8/index.js"></script> -->
        
        <!-- <script>
            $("#bfry").on("click",function(){
                DingTalkPC.biz.contact.choose({
                    startWithDepartmentId: 0, //-1表示打开的通讯录从自己所在部门开始展示, 0表示从企业最上层开始，(其他数字表示从该部门开始:暂时不支持)
                    multiple: false, //是否多选： true多选 false单选； 默认true
                    //users: [String, String, ...], //默认选中的用户列表，userid；成功回调中应包含该信息
                    corpId: 'dingbb7bd3d75122ab97', //企业id
                    max: 1, //人数限制，当multiple为true才生效，可选范围1-1500
                    onSuccess: function(data) {
                        console.log(data[0]);
                        $("#bfry").val(data[0].name);
                        $("#bfryid").val(data[0].emplId);

                    },
                    onFail : function(err) {
                        // alert(err);
                    }
                });
            })
        </script> -->
    </body>
</html>